package com.ctshk.rpc.user.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 *  常用旅客REQ
 * </p>
 *
 * @author 李新科
 * @date 2021/5/17 11:35
 */
@Data
@ApiModel()
@Accessors(chain = true)
public class PassengerReq implements Serializable {

    @ApiModelProperty(name = "id", value = "id,修改时传入")
    private Long id;

    @ApiModelProperty(value="用户id")
    private Long userId;

    @ApiModelProperty(value="英文姓",required = true)
    @Pattern(regexp = "^[a-zA-Z]+$",message = "英文姓只能为26个字母大小写")
    private String enSurname;

    @ApiModelProperty(value="英文名",required = true)
    @Pattern(regexp = "^[a-zA-Z]+$",message = "英文名只能为26个字母大小写")
    private String enName;

    @ApiModelProperty(value="称谓(1:先生;2:女士;3:小姐;4:男童;5:女童)",required = true)
    @NotNull(message = "称谓不能为空")
    private Integer appellation;

    @ApiModelProperty(value="联络电话区号",required = true)
    @NotBlank(message = "联络电话区号不能为空")
    private String contactMobileAreaCode;

    @ApiModelProperty(value="联络电话",required = true)
    @Pattern(regexp = "^[0-9]{8,11}$", message = "手机号必须是纯数字,并且是8到11位")
    private String contactNumber;

    @ApiModelProperty(value="电邮")
    private String email;

    @ApiModelProperty(value="出生日期")
    @NotNull(message = "出生日期不能为空")
    private LocalDate birthday;

    @ApiModelProperty(value="国籍id")
    private Long nationalityId;

    @ApiModelProperty(value="国籍名称")
    private String nationalityName;

    @ApiModelProperty(value="是否同意存储,0否,1是")
    private Integer isAgreeToStore = 0;

    @ApiModelProperty(value="旅客证件")
    @Valid
    private List<PassengerCertificatesReq> PassengerCertificatesList;
}
